import React, { Component } from 'react';

import { NavLink,Switch,Redirect,Route} from 'react-router-dom';
/*
NavLink 会生成 当前选中的a 标签一个className
Link 正常a 标签
Switch 包裹 路由进行匹配
Redirect 如果没有对应路由 则渲染到一个指定的页面 <Redirect to="/"/>
exact 地址严格模式
**/
// import LiefCycle from './view/life-cycle'
// import Event from './view/event-bak';
import Input from './view/input'
import Home from './view/home'
import Event from './view/event';
import State from './view/state';
import Tab from './view/event/tab.jsx';
import Web1904 from './view/web1904';
import Callback from './view/callback';
import Children from './view/children';
import Ref from './view/ref';
import AddEventListener from './view/addEventListener';
import Context from './view/context/App.jsx';


class App extends Component{
    // constructor(props){
    //     super(props);
    // }
    /**

    */
    render(){
        return (
            <Switch>
                <Route exact path="/" component={Home}/>
                <Route path="/input" component={Input}/>
                <Route path="/event" component={Event}/>
                <Route path="/callback" component={Callback}/>
                <Route path="/state" component={State}/>
                <Route path="/children" component={Children}/>
                <Route path="/ref" component={Ref}/>
                <Route path="/addEventListener" component={AddEventListener}/>
                <Route path="/context" component={Context}/>



                <Route exact path="/tab" component={Tab} />
                <Route path={`/tab/:token`} component={Tab} />

                <Route exact path="/web1904" component={Web1904} />
                <Route path={`/web1904/:id`} component={Web1904} />

                <Redirect to="/"/>
            </Switch>

        )
    }


}
export default App;
